package DynamicProgramming;


import java.util.Scanner;

/***
 * 打n枪，得m分，有多少种打法，每一枪0-10分
 * */
public class ShoutBalloon {

    static int n;
    static int m;
    static int res;
    static int[] arr;
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        n=input.nextInt();   //输入打的枪数
        m=input.nextInt();   //输入打中的环数
        input.close();
        arr=new int[n];
        res = 0;
        computer(0);
        System.out.println(res);
    }
    public static void computer(int time){
        if(time>=n){
            if(getSum()==m){
                res++;
                printf();
            }
            return;
        }

        for (int i = 0; i <= 10; i++) {
            arr[time]=i;
            computer(time+1);
        }
    }
    public static void printf(){
        for (int i = 0; i < n; i++) {
            System.out.print(arr[i]+"  ");
        }
        System.out.println();
    }
    public static int getSum(){
        int sum=0;
        for (int i = 0; i < n; i++) {
            sum+=arr[i];
        }
        return sum;
    }

}
